<?php
$product_name = $product_type = $country_id = $price = $laboratory = $product_description = "";
?>
<script src='jquery.js' type="text/javascript"></script>
<script src='documentation.js' type="text/javascript"></script>
<script src='jquery.MultiFile.js' type="text/javascript" language="javascript"></script>
<script type="text/javascript" src="<?php echo W_ROOT;?>/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="<?php echo W_ROOT;?>/jscripts/initialeditor.js"></script>
<script type="text/javascript" src="<?php echo W_ROOT;?>/templates/javascripts/jquery.foundation.tabs.js"></script>
<script type="text/javascript" src="<?php echo W_ROOT;?>/templates/javascripts/foundation.min.js"></script>
<script type="text/javascript" src="<?php echo W_ROOT;?>/templates/javascripts/app.js"></script>

<style type="text/css">
table {
    background: none repeat scroll 0 0 #FFFFFF;
    border: 0 solid #DDDDDD;
    border-radius: 3px 3px 3px 3px;
    margin: 0 -75px 18px;
}
table tbody tr td {
    border: medium none;
    color: #333333;
    padding: 9px 1px;
    vertical-align: top;
}
#backgroundPopup{  
            display:none;  
            position:fixed;  
            _position:absolute; /* hack for internet explorer 6*/  
            height:100%;  
            width:100%;  
            top:0;  
            left:0;  
            background:#000000;  
            border:1px solid #cecece;  
            z-index:1;  
}  
#popuptext{  
            display:none;  
            position:fixed;  
            _position:absolute; /* hack for internet explorer 6*/  
            height:400px;  
            width:650px;  
            background:#FFFFFF;  
            border:2px solid #cecece;  
            z-index:2;  
            padding:12px;  
            font-size:13px;  
} 
#popupCategory{  
            display:none;  
            position:fixed;  
            _position:absolute; /* hack for internet explorer 6*/  
            height:400px;  
            width:635px;  
            background:#FFFFFF;  
            border:2px solid #cecece;  
            z-index:2;  
            padding:12px; 
            overflow:scroll;
            overflow-x: hidden; 
} 
#popuptextClose{
            font-size:14px;
            line-height:14px;
            right:6px;
            top:4px;
            position:absolute;
            color:#6fa5fd;
            font-weight:700;
            display:block;
            cursor:pointer;
}
#popupcateClose{
            font-size:14px;
            line-height:14px;
            right:6px;
            top:4px;
            position:absolute;
            color:#6fa5fd;
            font-weight:700;
            display:block;
            cursor:pointer;
}
.check_bok
{
padding:2px;
margin:3px;
cursor:pointer;
color:#ffffff;
float: left;
}
.ch_red
{
   background: red;
}
</style>
<script language="javascript">  
    function fncCreateElement(){
      
    var mySpan = document.getElementById('mySpan');  
      
    var myLine = document.getElementById('hdnLine');  
    myLine.value++;  
      
    var myElement1 = document.createElement('input');  
    myElement1.setAttribute('type',"text");  
    myElement1.setAttribute('name',"txtsizename[]");  
    myElement1.setAttribute('style',"width:40px; float: left;margin-right:3px;height: 23px"); 
    myElement1.setAttribute('id',"txt"+myLine.value);  
    mySpan.appendChild(myElement1);  
      
    // Create <br>  
    var myElement2 = document.createElement('<br>');  
    myElement2.setAttribute('id',"br"+myLine.value);  
    mySpan.appendChild(myElement2);  
      
    }  
      
    function fncDeleteElement(){  
      
    var mySpan = document.getElementById('mySpan');  
      
    var myLine = document.getElementById('hdnLine');  
      
    if(myLine.value > 1 )  
    {  
      
    // Remove Text  
    var deleteEle = document.getElementById("txt"+myLine.value);  
    mySpan.removeChild(deleteEle);  
      
    // Remove <br>  
    var deleteBr = document.getElementById("br"+myLine.value);  
    mySpan.removeChild(deleteBr);  
      
    myLine.value--;  
    }  
    }  
    </script>
	<script src="popup.js" type="text/javascript"></script>
    

<div class="row">
<dl class="tabs">
  <dd class="active"><a href="#detail"><!--Product--><?php echo $lang['PRODUCT'] ; ?></a></dd>
  <dd><a href="#category"><!--Categories--><?php echo $lang['CATEGORIES'];?></a></dd>
</dl>
                <div class="four columns offset-by-eight">   
                    <div class="widget">                
                        <input class="btn btn-warning" type="button" value="<?php echo $lang['CANCEL'];?>" onclick="window.location.href='index.php'" />&nbsp;&nbsp;&nbsp;<input class="btn btn-primary" type="button" name="btnsubmit" value="<?php echo $lang['PUBLISH'];?>" onclick="checkSellerform();" />
                        <input type="hidden" name="hidid" value="<?php echo $id;?>" />
                    </div>
                </div>


    <div class="twelve columns">
        <ul class="tabs-content">                
                <!--detail section-->
              <li class="active" id="detailTab"> 
                  <!-- sidebar -->
    <div class="twelve columns">
        <div style="" class="lside">
            <div class="row">
                <div class="twelve columns">         
                    <label><!--Product Name --><?php echo $lang['PRO_NAME'] ;?>:</label>
                    <input type="text" style="width:98%;" name="new_proname" value="<?php echo stripslashes($product_name);?>" />
                </div>
                <div class="twelve columns">   
                    <div class="widget">         
                        <?php 
                             $str_color=mysql_query("SELECT *FROM tbl_color");
                     
                        ?>                        
                        <label><!--Color--> <?php echo $lang['COLOR'];?>:</label>
                        <?php while($rows_color=mysql_fetch_array($str_color)){ ?>
                        <div class="check_bok" style="background-color:<?php echo $rows_color['color_name']?>"> <input type="checkbox" name="txtcheckboxProduct[]" value="<?php echo $rows_color['color_id']?>" /></div>      
                        <?php } ?>
                        <div class="clear"></div>
                    </div>
                </div>
                
                
                
                <div class="twelve columns">
                    <div class="widget">                        
                        <label><!--Size--><?php echo $lang['SIZE'] ;?> :</label>                                
                        <div id="mySpan" style="float:left;"><input type="text" name="txtsizename[]" style="width:40px; float: left;margin-right:3px;height: 23px"/></div>  
                        <input id="hdnLine" name="hdnLine" type="hidden" value="1" /> 
                        <input class="btn" type="button" value="+" onClick="JavaScript:fncCreateElement();" id="adin" />
                        <input class="btn" type="button" name="btnDelete" value="-" onClick="JavaScript:fncDeleteElement();" id="adin"/>
                    </div>
                </div>
                
                
                
                <div class="twelve columns">
                    <div class="row widget">
                        <div class="three columns">
                            <label><!--Brand name--> <?php echo $lang['BRAND_NAME'];?>: </label> 
                                <?php
        							$b_get = mysql_query("SELECT * FROM tbl_brand"); 
        						?>
        						<select name="selectType" id="selectbox">
        							<option><!--Select Brand--><?php echo $lang['SEL_BRAND']; ?></option>
        							<?php
        							while ($brand = mysql_fetch_assoc($b_get))
        								{
        								?>    
        								<option value="<?php echo $brand['brand_name'];?>"><?php echo $brand['brand_name'];?></option>
        								<?php
        								}
        							?>
        				        </select>
                        </div>
                        <div class="three columns">
                             <label><!--Made In--><?php echo $lang['MADE_IN'];?> :</label>                         
                            <select name="selectCoun[]" id="selectbox" class="selectCon">
                                <option value="0"><!--select country--><?php echo $lang['SEL_COUNTRY'] ;?></option>
                                <?php
                            	$sql_coun = "SELECT id,country_name FROM tblcountries";
                            	$result_coun = mysql_query($sql_coun);
                            	while($row_coun = mysql_fetch_assoc($result_coun)){
                            	?>
                                <option value="<?php echo $row_coun['id']?>"><?php echo $row_coun['country_name']?></option>
                                <?php	
                            	}
                            	?>
                            </select>
                        </div>
                        <div class="six columns">
                            <div class="row">
                                <div class="six columns txtpricediv">
                                   <!-- Price($)--><?php echo $lang['PRICE'];?> :
                                    <input type="text" name="price[]" style="width:60px;margin-left:5px" value="" class="txtprice" />
                                </div>
                                <div class="six columns txtpricediv">
                                    <!--Regular Price($)--><?php echo $lang['REG_PRICE'];?> :
                                    <input type="text" name="price_regular[]" style="width:60px;" value="" class="txtprice_reg" />
                                </div>
                            </div> 
                        </div>                       
                    </div>
                </div>
                
                
                

                
                 
                

                
                <div class="twelve columns">
                    <div class="widget">
                        <label><!--Images --><?php echo $lang['IMG'];?>: </label> 
                        <input type="file" class="multi" name="imagefile[]" size="35"/>
                         <div class="imageitem"> 
                        	<?php
                        	$sql_img = "SELECT * FROM tblimage WHERE product_id =".$id;
                        	$result_img = mysql_query($sql_img);
                        	if(dbNumRows($result_img)){
                        	?>
                           <?php
                           	while( $row_img = mysql_fetch_assoc($result_img)){
                        		if($row_img['product_id'] !=""){
                           ?>
                           <div style="float:left;" class="div<?php echo $row_img['id'];?>">
                            <img src="images/<?php echo $row_img['thumbnail'];?>" class="border" />
                            </div>
                            <?php
                        		}//end if
                        	}//end if
                        	}//end while
                        	?>
                        </div>
                    </div>
                </div>                                     

                                                              
            </div>
        </div>      

    </div>
    <!-- end sidebar --> 
                             
                <label><!--Short Description--><?php echo $lang['SHORT_DESCRIP'];?> : </label>
                <textarea name="shot_disc" id="shot_disc" style="height:100px;width:99%;"><?php //echo stripslashes(short_desciption);?></textarea>
                <label><!--Long description--><?php echo $lang['LONG_DESCRIP'] ;?> :</label> 
                <textarea name="txtdesc" id="txtdesc" style="height:100px;width:99%;"><?php echo stripslashes($product_description);?></textarea>
                <!--end detail section-->
              </li>
              
              <!-- category section -->
              <li id="categoryTab">
                <?php
                	include('category.php');
                ?> 
              </li>
              <!-- end category section -->
              <input type="hidden" name="hidid" value="<?php echo $id;?>" />
        </ul>
    </div> 
  
    
</div>